package book;

public class Book {
    private String bookName;//书名
    private String author;//作者
    private double Price;//价格
    private String type;//图书类型
    private boolean statestate;//规定true表示未被借出，false表示被借出

    //书实例化对象的构造方法
    public Book(String bookname, String author, double price, String type) {
        this.bookName = bookname;
        this.author = author;
        Price = price;
        this.type = type;
        this.statestate = true;
    }

    //公开设置和得到属性值的方法
    public String getBookname() {
        return bookName;
    }

    public void setBookname(String bookname) {
        this.bookName = bookname;
    }

    public String getAuthor() {
        return author;
    }

    public void setAuthor(String author) {
        this.author = author;
    }

    public double getPrice() {
        return Price;
    }

    public void setPrice(double price) {
        Price = price;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public boolean isStatestate() {
        return statestate;
    }

    public void setStatestate(boolean statestate) {
        this.statestate = statestate;
    }
    //公开设置和得到属性值的方法end


    @Override
    public String toString() {
        return "Book{" +
                "书名：'" + bookName + '\'' +
                ", 作者：'" + author + '\'' +
                ", 价格：" + Price +
                ", 类型：'" + type + '\'' +
                (statestate?", 未被借出":", 已被借出")
                + '}';
    }
}